﻿/*
 * XCoder v3.2.2010.1014
 * 作者：SUN/SUN-PC
 * 时间：2010-12-22 19:56:20
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;

namespace NewLife.YWS.Entities
{
	/// <summary>
	/// 客户类型
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("客户类型")]
    [BindTable("CustomerType", Description = "客户类型", ConnName = "YWS")]
    public partial class CustomerType 
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn("ID", Description = "编号", DefaultValue = "", Order = 1)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn("Name", Description = "名称", DefaultValue = "", Order = 2)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private Int32 _ParentID;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn("ParentID", Description = "", DefaultValue = "", Order = 3)]
		public Int32 ParentID
		{
			get { return _ParentID; }
			set { if (OnPropertyChange("ParentID", value)) _ParentID = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, true, 23)]
		[BindColumn("AddTime", Description = "添加时间", DefaultValue = "", Order = 4)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _Operator;
		/// <summary>
		/// 添加人
		/// </summary>
		[Description("添加人")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn("Operator", Description = "添加人", DefaultValue = "", Order = 5)]
		public String Operator
		{
			get { return _Operator; }
			set { if (OnPropertyChange("Operator", value)) _Operator = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return ID;
					case "Name" : return Name;
					case "ParentID" : return ParentID;
					case "AddTime" : return AddTime;
					case "Operator" : return Operator;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "ParentID" : _ParentID = Convert.ToInt32(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "Operator" : _Operator = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得客户类型字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 
			///</summary>
			public const String ParentID = "ParentID";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 添加人
			///</summary>
			public const String Operator = "Operator";
		}
		#endregion
	}
}